package com.chu.demo;

public class DeadLock2 {

    public static void main(String[] args) {

        Dead d1 = new Dead();

        new Thread(d1::dead,"A").start();
        new Thread(d1::dead,"B").start();
    }

}


class Dead{


    public synchronized void dead(){
        System.out.println("ThreadName:"+Thread.currentThread().getName());
        while (true){

        }
    }

}

